﻿
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/icon.css" />

<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>

</head>
<script type="text/javascript">
$(function(){	
	
	$('#btn').linkbutton({ 
		
	    onClick:function(){
	    	$("#myform").form({
	    		url:'updatePsw',
	    		success:function(data){
	    			if(data==1){
	    			$.messager.confirm({
	    				title:'信息提示',
	    				msg:'修改成功',
	    				timeout:1000,
			    		showType:'slide'
			    		
	    			})
	    			 $("#oldpsw").val("");
		             $("#newpsw").val("");
		             $("#newpsw1").val(""); 
	                
	               
	    			}
	    		}
	    	})
	    var oldpsw=$("#oldpsw").val();
	    var upsw=${sessionScope.User.upsw};
	    var newpsw=$("#newpsw").val();
	    var newpsw1=$("#newpsw1").val();
	   
	    	if(oldpsw==upsw&&newpsw1==newpsw){
	    		$("#myform").submit();
	    		
	    	}else{
	    		$.messager.confirm({
	    			title:'信息提示',
	    			msg:'修改失败,密码不一致',
	    			
	    		})
	    	}
	    	 /*  $("#oldpsw").val("");
             $("#newpsw").val("");
             $("#newpsw1").val(""); */ 
	    	
	    }          
	
	}); 
	

})
</script>
<body>


 <!-- 修改个人密码 -->

<table id="dg"></table>
<div id="log"   closed="false" >
						<form id="myform" method="post">
						<input id="uid" name="uid" type="text" style="display: none;">
                         <br>
                         <br>   
<!-- 						<input id="oldpsw" name="oldpsw" type="password" style="width:200px;">原密码
 -->						<input id="oldpsw" name="oldpsw" type="password" class="easyui-validatebox" data-options="required:true" />原密码   
						
						<br>
						<br>
<!-- 						<input id="newpsw" name="newpsw" type="password" style="width:200px" >新密码
 -->						<input id="newpsw" name="newpsw" type="password" class="easyui-validatebox" data-options="required:true" />新密码  
						
						<br>
					    <br>
<!-- 					    <input id="newpsw1" name="newpsw1" type="password" style="width:200px" >再次输入新密码
 -->					    <input id="newpsw1" name="newpsw1" type="password" class="easyui-validatebox" data-options="required:true" />再次输入新密码  
					    
						<br>
					    <br>
						<a id="btn" class="easyui-linkbutton" >确认修改</a> 
						 
					    </form>
</div>
				

</body>
</html>
